package com.minimalist.common.entity.lindi.vo.tradeapplicationinvoice;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.minimalist.common.config.mybatis.bo.PageReq;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serial;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Objects;

/**
 * @author 11987
 */

@Schema(name = "林地指标交易平台_交易申请发票管理查询实体")
public class LindiTradeApplicationInvoiceQueryVO extends PageReq implements Serializable{
    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(name = "invoiceNumber", description = "发票编号", type = "string")
    private String invoiceNumber;

    @Schema(name = "invoiceType", description = "发票类型", type = "string")
    private String invoiceType;

    @Schema(name = "invoiceDate", description = "开票日期", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private Timestamp invoiceDate;

    public LindiTradeApplicationInvoiceQueryVO(Long pageNum, Long pageSize){
        super(pageNum, pageSize);
    }

    public LindiTradeApplicationInvoiceQueryVO(Long pageNum, Long pageSize, String invoiceNumber, String invoiceType, Timestamp invoiceDate){
        super(pageNum, pageSize);
        this.invoiceNumber = invoiceNumber;
        this.invoiceType = invoiceType;
        this.invoiceDate = invoiceDate;
    }

    public String getInvoiceNumber(){
        return invoiceNumber;
    }

    public void setInvoiceNumber(String invoiceNumber){
        this.invoiceNumber = invoiceNumber;
    }

    public String getInvoiceType(){
        return invoiceType;
    }

    public void setInvoiceType(String invoiceType){
        this.invoiceType = invoiceType;
    }

    public Timestamp getInvoiceDate(){
        return invoiceDate;
    }

    public void setInvoiceDate(Timestamp invoiceDate){
        this.invoiceDate = invoiceDate;
    }

    @Override
    public boolean equals(Object o){
        if (this == o){
            return true;
        }
        if (o == null || getClass() != o.getClass()){
            return false;
        }
        if (!super.equals(o)){
            return false;
        }
        LindiTradeApplicationInvoiceQueryVO that = (LindiTradeApplicationInvoiceQueryVO) o;
        if (!Objects.equals(invoiceNumber, that.invoiceNumber)){
            return false;
        }
        if (!Objects.equals(invoiceType, that.invoiceType)){
            return false;
        }
        if (!Objects.equals(invoiceDate, that.invoiceDate)){
            return false;
        }
        return true;
    }

    @Override
    public int hashCode(){
        int result = super.hashCode();
        result = 31 * result + (invoiceNumber != null ? invoiceNumber.hashCode() : 0);
        result = 31 * result + (invoiceType != null ? invoiceType.hashCode() : 0);
        result = 31 * result + (invoiceDate != null ? invoiceDate.hashCode() : 0);
        return result;
    }
}
